//
//  CustomTableCell.h
//  GridViewTest1
//
//  Created by Eidan Lin on 12-12-17.
//  Copyright (c) 2012年 taomm. All rights reserved.
//

#import <UIKit/UIKit.h>
@class CustomIndexPath;
@class CustomGridView;

@protocol CustomTableCellDelegate;

@interface CustomTableCell : UIView

//一定要有
@property (nonatomic,strong) IBOutlet UIView *customView;
@property (strong, nonatomic) NSString *reuseIdentifier;
@property (strong, nonatomic) CustomIndexPath *indexPath;


-(id)initWithIdentifier:(NSString *)identifier;

//根据需要来
@property (nonatomic,strong) UIView *containerView;
@property (nonatomic,strong) UIImageView *fakeImageView;
@property (nonatomic,strong) UIImageView *trueImageView;
@property (nonatomic,strong) UILabel *tilteLabel;
@property (nonatomic,strong) UILabel *infoLabel;
@property (nonatomic,strong) UIButton *clickBtn;
@property (nonatomic,strong) UIButton* priseBtn;


//---------------------------------------------------------编辑模式 start---------------
@property (weak, nonatomic) id<CustomTableCellDelegate>delegate;
@property (assign, nonatomic) BOOL isInEditingMode;
@property (strong, nonatomic) UIButton *selectedBtn;
@property (strong, nonatomic) UIView *selectedBtnBgView;
@property (strong, nonatomic) CustomGridView *parent;
@property (assign, nonatomic) int index;   //编辑模式才会用到，这个才会准。

//每个cell进入和退出编辑模式
-(void)customTableCellSetEdit:(BOOL)edit andAnimation:(BOOL)animation;

//每个cell在添加到视图前，应该处理一下，他是否在编辑模式，是否已经选择，都要进行处理。。
-(void)handleIsInEditingModeWithParent:(CustomGridView *)parent andIsInEditing:(BOOL) edit;

//---------------------------------------------------------编辑模式 end---------------


@end

@protocol CustomTableCellDelegate <NSObject>

@optional
-(void)customGridViewTableCellInEditingModeAndSelectedBtnHasClicked:(CustomTableCell *)customTableCell;


@end


@interface CustomIndexPath : NSObject

+ (CustomIndexPath *)indexPathForRow:(NSInteger) row inColumn:(NSInteger)column;

@property(assign, nonatomic) NSInteger row;   //行
@property(assign, nonatomic) NSInteger column;  //列

@end
